import {Entity, PrimaryGeneratedColumn, Column, ManyToOne, BaseEntity} from 'typeorm';
import { Order } from './order.entity';
import { Region } from './region.entity';

@Entity()
export class OrderPackage extends BaseEntity {
    @PrimaryGeneratedColumn()
    id: number;

    @ManyToOne(() => Order)
    order: Order;

    @Column()
    deliveryCompany: string;

    @Column()
    deliverySn: string;

    @Column()
    deliveryTime: Date;

    @Column()
    freightAmount: number;

    @Column('json')
    consigneeInfo: {
        name: string;
        phone: string;
        province: Region;
        city: Region;
        district: Region;
        street: Region;
        detailAddress: string;
    };

    @Column()
    automaticReceiveGoodsDays: number;

    @Column()
    status: number;

    @Column()
    receiveTime: number;

    @Column()
    remark: string;
}
